<?php
include_once("db_connect.php");
$postdata = file_get_contents("php://input");
if (isset($postdata) && !empty($postdata)) {
    $request = json_decode($postdata);
    $username = mysqli_real_escape_string($mysqli, trim($request->username));
    $password = mysqli_real_escape_string($mysqli, trim($request->password));
    $phone = trim($request->phone);

    $sql = "INSERT INTO login_user (username, password, phone, accesstoken) VALUES ('$username', '$password', '$phone', 1)";


    if ($mysqli->query($sql)) {
        $data = array('message' => 'ADD Admin Success');
        echo json_encode($data);
    } else {
        $data = array('message' => 'ADD Admin Falied');
        echo json_encode($data);
    }
}
